package xaj.scc.ast;

import polyglot.ext.jl.ast.Node_c;
import polyglot.util.CodeWriter;
import polyglot.util.Position;
import polyglot.visit.PrettyPrinter;

public class SyntaxDeclarationOverrides_c extends Node_c implements
		SyntaxDeclarationOverrides {

	private String nonTerminal;
	
	public SyntaxDeclarationOverrides_c(Position pos, String nonTerminal) {
		super(pos);
		this.nonTerminal = nonTerminal;
	}

	public String getNonTerminal() {
		return nonTerminal;
	}

	public SyntaxDeclarationOverrides setNonTerminal(String nonTerminal) {
		SyntaxDeclarationOverrides_c node = (SyntaxDeclarationOverrides_c) copy();
		node.nonTerminal = nonTerminal;
		return node;
	}

	public void prettyPrint(CodeWriter w, PrettyPrinter tr) {
		w.newline(4);
		w.begin(0);
		w.write("@grammar overrides " + nonTerminal + ";");
		w.end();
	}
	
	@Override
	public void accept(Visitor v) {
		v.visitSyntaxDeclarationOverrides(this);
	}
	
}
